:root {
    --primary-color: #59a866;
    --secondary-color: #754fe7;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --category-bg: #e3f2fd;
    --out-of-stock-bg: #fff8f8;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: var(--dark-text);
    line-height: 1.6;
    padding: 20px;
}

.app {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.product-table-container {
    padding: 25px;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.stock-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.stock-filter input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: var(--card-shadow);
    border-radius: 10px;
    overflow: hidden;
}

.product-table th {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
}

.product-table th:first-child {
    border-top-left-radius: 10px;
}

.product-table th:last-child {
    border-top-right-radius: 10px;
}

.product-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.product-table tr:last-child td {
    border-bottom: none;
}

.category-row {
    background-color: var(--category-bg);
    font-weight: bold;
    font-size: 1.1rem;
}

.category-row td {
    padding: 12px 20px;
    color: var(--secondary-color);
    font-weight: 600;
}

.out-of-stock {
    background-color: var(--out-of-stock-bg);
}

.stock-indicator {
    color: var(--danger-color);
    margin-right: 8px;
}

.in-stock {
    color: var(--success-color);
    font-weight: 500;
    background: rgba(40, 167, 69, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.out-of-stock-text {
    color: var(--danger-color);
    font-weight: 500;
    background: rgba(220, 53, 69, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--light-text);
}

.no-results h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark-text);
}

.no-results p {
    color: var(--light-text);
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-table {
        display: block;
        overflow-x: auto;
    }

    .search-bar {
        flex-direction: column;
    }

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .product-table th,
    .product-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .category-row td {
        font-size: 1rem;
    }

    .app {
        border-radius: 0;
    }

    body {
        padding: 0;
    }
}